﻿using DevExpress.Export;
using DevExpress.XtraCharts;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraPrinting;
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DevUIUtils
{
    public static class ChartControlEx
    {
        /// <summary>
        /// ChartControl导出Png图片
        /// </summary>
        /// <param name="chart">ChartControl对象</param>
        public static void ExportPng(this ChartControl chart)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog() { Title = "导出图片", Filter = "Png图片|*.Png" };
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                chart.ExportToImage(saveFileDialog.FileName, ImageFormat.Png);

            }
        }
    }
}
